const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports={
    mode:"development",
    entry:path.resolve(__dirname,"./src/index.ts"),
    output:{
        path:path.resolve(__dirname,"dist"),
        
        filename:'bundle.js'
    },
    module: {
        unknownContextCritical:false,
        rules: [  // 添加解析规则
            {
                test: /\.tsx?$/,
                loader: 'ts-loader',
                exclude: /node_modules/,
            },
        ]
    },
    resolve: {   // 需要打包的文件后缀
        extensions: [".tsx", ".ts", ".js"]
    },
    plugins:[
        new HtmlWebpackPlugin({
            template:'index.html'
        })
    ],
    // devServer:{
    //     allowedHosts:"all",
    //     contentBase:path.join(__dirname,'.'),
    //     open:true,
    //     port:9000
    // }
}　